var sysRecordTable;
$(function () {
    sysRecordTable = $('#systemRecordTable').dataTableExtend({
        "ajax": sysInfo.basePath+"/sys_record/sys_record_data.do",
        "fnServerParams": function (aoData) {
            aoData = $.extend(aoData, getSearchData());
            return aoData;
        },
//			    	"select":true,
//			    	"scrollX":"true",//是否开启横项滚动
//					"fixedColumns":   {//锁定列，只有开启scrollX时才生效
//			            "leftColumns": 2,//左侧锁定2列
//			            "rightColumns": 1//右侧锁定1列
//			        },
        "aoColumns": [
            /*{
                "sClass": "check-th",
                "orderable": false,
                "data": "ID",
                "render": function (data, type, full, meta) {
                    return '<input type="checkbox"  class="checkchild"  value="' + data + '" />';
                }
            },*/
            {
                "title":"序号",
                "render": function (data, type, full, meta) {
                    return meta.row+1;
                },
                "orderable": false
            },
            {
                "title":"业务表名",
                "data": "workTableName",
                "orderable": false
            },
            {
                "title":"业务Id",
                "data": "workId",
                "orderable": false
            },
            {
                "title":"所属事业部",
                "data": "signOrgName",
                "orderable": false
            },
            {
                "title":"业务编号",
                "data": "workNo",
                "orderable": false
            },
            {
                "title":"证书名称",
                "data": "certificateName",
                "orderable": false
            },
            {
                "title":"证书编号",
                "data": "certificateCode",
                "orderable": false
            },
            {
                "title":"证书类型",
                "data": "certificateType",
                "orderable": false
            },
            {
                "title":"操作类型",
                "data": "operateType",
                "orderable": false
            },
            {
                "title":"操作时间",
                "data": "operateTime"
            },
            {
                "title":"操作人",
                "data": "operaterName",
                "orderable": false
            },
            {
                "title":"备注",
                "data": "remarks",
                "orderable": false
            }
        ],
    });
});

function searchSysRecordTable(){
    sysRecordTable.ajax.reload();
}

/**
 * 获取搜索数据
 * @returns {*|jQuery}
 */
function getSearchData() {
    return $('#sysRecordControllerForm').serializeObject();
}

/**
 * 导出
 */
function exportData(){
    var params = $('#sysRecordControllerForm').serialize();
    console.log(params);
    window.location.href = encodeURI(sysInfo.basePath+"/sys_record/export_sys_record.do?"+params);
}